﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DotNetNinjaLibrary
{
	public static class MathsHelper
	{
		public static long TimeForDiagonal(long straightTime)
		{
			return (long)(straightTime * 1.41);
		}

		public static Direction GetDirection(Basics.Point from, Basics.Point to)
		{
			if (from.X > to.X)
			{
				if (from.Y > to.Y)
					return Direction.NorthWest;
				else if (from.Y == to.Y)
					return Direction.West;
				else
					return Direction.SouthWest;
			}
			else if (from.X == to.X)
			{
				if (from.Y > to.Y)
					return Direction.North;
				else if (from.Y == to.Y)
					return Direction.None;
				else
					return Direction.South;
			}
			else
			{
				if (from.Y > to.Y)
					return Direction.NorthEast;
				else if (from.Y == to.Y)
					return Direction.East;
				else
					return Direction.SouthEast;
			}
		}
	}
}
